//
//  GFNetWorkingTools.h
//  lib.utils
//
//  Created by 胡林虎 on 2017/6/30.
//  Copyright © 2017年 胡林虎. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "GFNetConstant.h"


@interface GFNetWorkControl : NSObject

//get post请求
+ (void)requestURL:(NSString*)url
          hostType:(HostStatusStyles)hostType
            parmas:(NSDictionary*)dic
cacheTimeInSeconds:(NSInteger)cacheTime
    requestSuccess:(SucessBlock)sucessBlock
     requestFailed:(FailedBlock)failedBlock;


//先加载缓存后请求
+ (void)requestFromCacheURL:(NSString *)url
                          hostType:(HostStatusStyles)hostType
                            parmas:(NSDictionary *)dic
                    requestSuccess:(SucessBlock)sucessBlock
                     requestFailed:(FailedBlock)failedBlock;

//图片上传
+ (void)uploadImage:(NSString *)url
                  hostType:(HostStatusStyles)hostType
                   paramas:(NSDictionary *)dic
                     image:(UIImage *)image
            requestSuccess:(SucessBlock)sucessBlock
             requestFailed:(FailedBlock)failedBlock;

//带toast的网络请求
+ (void)requestURLWithToast:(NSString*)url
                          hostType:(HostStatusStyles)hostType
                            parmas:(NSDictionary*)dic
                cacheTimeInSeconds:(NSInteger)cacheTime
                         needToast:(BOOL)needToast
                    requestSuccess:(SucessBlock)sucessBlock
                     requestFailed:(FailedBlock)failedBlock;


@end
